import 'package:boss/provider/staff_provider.dart';
import 'package:boss/ui/page/staff/widget/staff_list.dart';
import 'package:boss/ui/widget/search_bar.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class StaffBrowser extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(
        vertical: 30.w,
      ),
      child: Column(
        children: <Widget>[
          Padding(
            padding: EdgeInsets.symmetric(
              horizontal: 30.w,
            ),
            child: SearchBar(
              hintText: '请输入搜索姓名',
              onChanged: (value) {
                var staffProvider = Provider.of<StaffProvider>(
                  context,
                  listen: false,
                );
                staffProvider.searchWord = value;
              },
              onEditingComplete: () {
                var staffProvider = Provider.of<StaffProvider>(
                  context,
                  listen: false,
                );
                staffProvider.searchComplate();
              },
            ),
          ),
          StaffList(),
        ],
      ),
    );
  }
}
